import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import request from "@/utils/request";
// 导入 amfe-flexible 动态设置 rem 基准值
// 根据窗口可视化大小自动设置 html 标签的 font-size
import "amfe-flexible";
// 导入 XrUI UI组件库
import XrUI from "./../packages";
// 导入 vant UI组件库
import Vant from 'vant'
import 'vant/lib/index.css'
// 导入 icon
import '@/assets/icon/iconfont.js'
import "@/assets/styles/icon.css"
import "@/assets/icon/iconfont.css"
// 导入 animate.css
import animated  from 'animate.css'

// 导入 validate
import '@/utils/validate'

Vue.use(XrUI).use(Vant).use(animated)

// 将 axios 注册到原型
Vue.prototype.$axios = request;

Vue.config.productionTip = false;

// const requireContext = require.context("./views", true, /\.vue$/);
// requireContext.keys().forEach((filename) => {
//   // 组件实例
//   let reqCom = requireContext(filename)
//   let reqComName = filename.split('/')[filename.split('/').length - 1].split('.')[0]
//   Vue.component(reqComName, reqCom.default || reqCom)
// })

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
